Arcade Fighter
==============
***The game engine that teaches!***
~~***The game engine that teaches!***~~

The Arcade Fighter Library is a studying project.

It is __NOT__ in any way or form a stable and robust commercial game engine, it is offered as is with no guaranties. We
may get there one day, but for now, it's simply not the objective of this project to offer a professional solution. It
should fill all the needs for a complete and well round game though, just don't expect live support.

What we mean by a *studying project* is that it's meant for people studying programming (mainly C/C++), software
engineering and game design in all its forms and levels. Maybe not well suited for complete beginners flying solo,
but it offers a transparent box for the initiated to crawl through and play with. Our code tries to be easy to read and
well documented as much as possible, we follow good practices and well established standards so you may follow too,
all our sources for ideas and algorithms are stated at the classes headers for the ones wishing for a deep dive on
specific subjects.

For now, we'll stay focused in being a "programmer's engine", since there is A LOT to be done just in that sense, but
we will eventually implement some features and tools to make life more enjoyable for game designers and graphical artist.
Although, in essence, this will still be a programmers oriented project.

The true power of this project though is way way other than building good games! No, to at all!

We intend on tricking you into learning and even to study of your own volition (gasp).


### Dependencies
The following list of dependencies are for a clean Debian 12 installation, it should be very similar to any other distro.

Be sure the drivers for your graphics card are updated, check the OpenGl with `glxinfo | grep "OpenGL version"`. The
minimal version is 4.3 if you need asynchronous error logging for OpenGl, but it can be downgraded to a lesser version
otherwise.

Accept any extra dependencies the package manager asks to download.

    sudo apt-get install build-essential libsdl2-dev libsdl2-mixer-dev libglm-dev libfmt-dev

Optional packages:

    sudo apt-get install git doxygen cpputest

ArcadeFighter also depends on [glad](https://github.com/Dav1dde/glad) to load OpenGL's bindings, a copy of glad is
already provided for OpenGl Core 4.3. If you need to change the version or extend its properties, a new file can be
generated at [Glad² Generator](https://gen.glad.sh/).


## How to use the project
Although this engine is perfectly capable of supporting any kind of 2D game (maybe, who knows?!), we chouse to focus on
classic 2D style arcade fighting games.

The source code is well documented and the project file structure should be simple to follow for anyone with a
little of C/C++ programming experience.

Proper documentation can be found at the [/doc](doc/) directory. Considering most classes and APIs are very
straightforward, not all modules will have specific documentation but the most complex.

A much more rich (and probably up to date) HTML documentation can be generated based on the header comments using
[Doxygen](https://www.doxygen.nl/manual/index.html). Just go to the root of the library and run the command `doxygen`,
you can access it through [doc/ArcadeFighterDoc_index.html](doc/ArcadeFighterDoc_index.html)

We are assuming most people will try to build a fighting game in the stile of arcade games like Street Fighter, King
of Fighters or Samurai Showdown. If you are starting with game development, take some time to follow the examples
already provided and pay attention specially to the sub classes and base classes comment sections, there are many
external resources that can help you in your present and future endeavors. Just play around until something breaks,
try to modify the characters behavior, the sprite sheets, experiment with different game loop regimes and, eventually,
build something yours just by substituting the content with your own.

More advanced users will probably just take a look at the ins and outs and discard the examples altogether. The
important bits are the startup sequence, the loading procedures and abstract methods in most base classes. The classes
comment section has more specif examples of how to deal with each class isolated. In all honest, even classes
like ArcadeFighter (the highest level class, abstracting all the other engine's functionalities) are just suggestions
of how it could be done in your own game.

You are expected to compile the engine as a static library and link it with your project, but it is perfectly valid to
compile everything together if you intend on modifying the engine frequently and extensively.

But! Those are just means to an end, we really want to trick you into being a better [programmer | architect | designer
| artist | musician?] and this project offers lots and lots of opportunities for you to dive into any of those subjects
at any time.

## Compiling
This library was designed and developed having GNU/Linux and FOSS in mind, you can manage to compile and run under
Windows within WSL in fairly the same manner and it is untested on OSX.

The following instructions are for building the standalone ArcadeFighter Library.

~~The command `make [-h | --help]` should output a complete list of accepted options to use.~~

Calling `make -j all` will compile the Library and its dependencies, generating a static library file called
_**libArcadeFighter.a**_. We recommend the use of the **-j** parameter as to speed up the build using all the available
CPU cores/threads. If you don't know what to do with that file, check the ArcadeFighter Demo Makefile to have a better
idea.

If you did not alter the code in any form and encountered errors during compilation, take a look at the previous list
of dependencies and check they are all correctly installed in your system. ~~If the error persists, check the
troubleshooting list at the end.~~


## Main Author
Most of ArcadeFighter was created by André Frazatto (AKA TooOld2Rock'nRoll)


## Credits
This project would not be possible without people like [Joey de Vries](https://joeydevries.com/#home) from
[LearnOpenGL](https://learnopengl.com/) and [Bob Nystrom](https://journal.stuffwithstuff.com/) from
[Game Programming Patterns](https://gameprogrammingpatterns.com/) that generously donated their experience and time to
build those resources and offer it online for free, helping to inspire countless others like myself.


## License
> The ArcadeFighter Demo is free software: you can redistribute it and/or modify it under the terms of the GNU General
> Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
> later version.
>
> The ArcadeFighter Demo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
> implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
> more details.
>
> You should have received a copy of the GNU General Public License along with this program. If not,
> see <https://www.gnu.org/licenses/>.

ArcadeFighter rendering is derivative of [Breakout](https://learnopengl.com/In-Practice/2D-Game/Breakout).
Breakout is free software: you can redistribute it and/or modify it under the terms of the
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license as published by Creative Commons, either version 4
of the License, or (at your option) any later version.

ArcadeFighter uses [glad](https://github.com/Dav1dde/glad) to load OpenGL's bindings.
The generated code from glad is any of Public Domain, [WTFPL](http://www.wtfpl.net/about/) or
[CC0](https://creativecommons.org/publicdomain/zero/1.0/).

ArcadeFighter uses the [Simple DirectMedia Layer](https://www.libsdl.org/index.php) library v2 (SDL2 for short) for
window management and audio. SDL2 and newer are provided under the [zlib library](https://www.zlib.net/zlib_license.html).

ArcadeFighter uses the [STB library](https://github.com/nothings/stb) to load image files and deal with fonts.
Sean Barrett's STB library is published under the [MIT License](https://mit-license.org/) or Public Domain.

ArcadeFighter uses [CppUTest](https://cpputest.github.io/) to implement and run Unit Tests.
CppUTest framework is published under the [BSD 3-Clause "New" or "Revised"
License](https://en.wikipedia.org/wiki/BSD_licenses) and requires that the following disclaimer is displayed in our
project/documentation distribution:
> Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde
> All rights reserved.
>
> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
>
>    Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
>    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
>    Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ArcadeFighter makes extensive use of [Doxygen](https://www.doxygen.nl/index.html) to generate detailed documentation
based on source files comments. Doxygen is published under the GNU General Public License
[license](https://www.doxygen.nl/license.html).

(If you don't understand the point of these licenses and don't understand the difference between _Open Source_ and _Free
Open Source Software_ (or FOSS for short), this may be a good reading [The GNU Project](https://www.gnu.org/gnu/thegnuproject.html))


## Contact
If your problem or subject can't be solved through one of our other social links, you can get in contact
true <arcadefighter_dev@riseup.net>, we just can't promise to return your e-mail in timely fashion.


---
This is `README.md` for the ArcadeFighter Library.

